

<div id="stockImage">
	<img src="images/products/<?php echo $obj->getImage();?>" width="290" height="290">
</div>
<div id="orderPart">
	<table class="stockView">
		<tr>

			<td colspan="2">
				<h2 id="name"><?php echo $obj->getName();?></h2>
			</td>
		</tr>
		<tr>
			<td class="left">
				Категория :
			</td>
			<td class="right">
				<?php echo $obj->getCategory();?>
			</td>
		</tr>
		<tr>
			<td class="left">
				Производител :
			</td>
			<td class="right">
				<a href='?page=search&searchField=<?php echo $obj->getProducer();?>'>
				<?php echo $obj->getProducer();?>
				</a>
			</td>
		</tr>
		<tr>
			<td class="left">
				Цена :
			</td>
			<td class="right" <?php if ($obj->getPromoPrice() != null) echo ' id="promotion"';?>>
				<?php printf("%.2f лв",$obj->getPrice());?>
			</td>
		</tr>
		<?php
			if ($obj->getPromoPrice() != null){
			echo '<tr>
						<td class="left">
							Промоционална Цена :
						</td>
						<td class="right">
							';
			printf("%.2f лв",$obj->getPromoPrice() );

			echo			'</td>
				</tr>';
			}
			if ($obj->getPromo() != null){
				echo '		<tr>
								<td class="left">
									Промоция :
								</td>
								<td class="right">
									<font color="black">'.$obj->getPromo().'</font>
								</td>
							</tr>';
			}
		?>

		<tr>
			<td class="left">
				Минимално количество :
			</td>
			<td class="right">
				<?php echo $obj->getMinimumQuantity()." ". $obj->getQuantity();?>
			</td>
		</tr>



		<tr>
			<td class="left">
				Количество :
			</td>
			<td class="right">
				<input type="text" value="<?php echo $obj->getMinimumQuantity(); ?>" id="quantity" id="quantity" style="width:25px;text-align: right;">
			</td>
		</tr>
		<tr id="buy">
			<td colspan="2">

				<input type="button" id="button" class="button" value="Поръчай" >
			</td>
		</tr>
	</table>
</div>
<div id="description">
	<?php
		echo $obj->getDescription();
	?>
</div>
<script>
	$('.button').click(function(){
		var Quantity = $("#quantity").val();
		var productName = $("h2#name").text();
		$.get("cntrlr/Cart.php", { quantity: Quantity, name: productName })
			.done(function(data) {
				$("#cart").hide(500,function(){
					$(this).html(data).show(500);

				});
				});

			});
</script>